<!doctype html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Amaze UI Admin index Examples</title>
    <meta name="description" content="这是一个 index 页面">
    <meta name="keywords" content="index">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="icon" type="image/png" href="__STATIC__/assets/i/favicon.png">
    <link rel="apple-touch-icon-precomposed" href="__STATIC__/assets/i/app-icon72x72@2x.png">
    <meta name="apple-mobile-web-app-title" content="Amaze UI" />
    <link rel="stylesheet" href="__STATIC__/assets/css/amazeui.min.css" />
    <link rel="stylesheet" href="__STATIC__/assets/css/admin.css">
    <link rel="stylesheet" href="__STATIC__/assets/css/app.css">
</head>

<body data-type="generalComponents">
    {include file="public:head"/}

    {include file="public:sidemenu"/}

    

        <div class="tpl-content-wrapper">
            <div class="tpl-content-page-title">
                修改晒图
            </div>
            <ol class="am-breadcrumb">
                <li><a href="#" class="am-icon-home">列表</a></li>
                <li><a href="#">表单</a></li>
                <li class="am-active">修改晒图</li>
            </ol>
            <div class="tpl-portlet-components">
                <div class="portlet-title">
                    <div class="caption font-green bold">
                        <span class="am-icon-code"></span> 表单
                    </div>
                    
                </div>

                <div class="tpl-block">

                    <div class="am-g">
                        <div class="tpl-form-body tpl-form-line">
                            <form class="am-form tpl-form-line-form" method="post" enctype="multipart/form-data" action="{:url('formshowpic/updateshowpic',['id'=>$showpic.showpicid])}">
                                <input type="hidden" name="userid" value="{$showpic.userid}">
                                <div class="am-form-group">
                                    <label for="user-name" class="am-u-sm-3 am-form-label">所属俱乐部 <span class="tpl-form-line-small-title">Club</span></label>
                                    <div class="am-u-sm-9">
                                        <select data-am-selected="{searchBox: 0}" name="clubid">
                                            {volist name="clublist" id="vo"}
                                            {if condition="$showpic.clubid==$vo.clubid"}
                                            <option value="{$vo.clubid}" selected="select">{$vo.clubname}</option> 
                                            {else /}
                                            <option value="{$vo.clubid}">{$vo.clubname}</option>   
                                            {/if}
                                            {/volist}                                      
                                        </select>
                                    </div>
                                </div>
                                
                         
                                <div class="am-form-group">
                                    <label for="user-weibo" class="am-u-sm-3 am-form-label">晒图 <span class="tpl-form-line-small-title">Showpic</span></label>
                                    <div class="am-u-sm-9">
                                        <div class="am-form-group am-form-file">
                                            <div class="tpl-form-file-img">
                                                <img src="__STATIC__/posters/{$showpic.showpicpath}" alt="" id="photo">
                                            </div>
                                            <button type="button" class="am-btn am-btn-danger am-btn-sm">
    <i class="am-icon-cloud-upload"></i> 添加图片</button>
                                            <input type="hidden" name="pic2" id="pic_edit2" value="{$showpic.showpicpath}">
                                            <input id="doc-form-file" onchange="preImg(this.id,'photo');" type="file" name="pic" multiple >
                                        </div>

                                    </div>
                                </div>

                                <div class="am-form-group">
                                    <label for="user-intro" class="am-u-sm-3 am-form-label">正文</label>
                                    <div class="am-u-sm-9">
                                        <textarea class="" rows="10" id="user-intro" name="showpiccontent" placeholder="请输入内容">{$showpic.showpiccontent}</textarea>
                                    </div>
                                </div>

                                

                                <div class="am-form-group">
                                    <div class="am-u-sm-9 am-u-sm-push-3">
                                        <button type="submit" class="am-btn am-btn-primary tpl-btn-bg-color-success ">提交</button>
                                    </div>
                                </div>
                               
                            </form>

                        </div>
                    </div>
                </div>


            </div>

        </div>

    </div>


    {include file="public:footer"}
</body>
<script type="text/javascript">  
            function getFileUrl(sourceId) {  
                var url;  
                if (navigator.userAgent.indexOf("MSIE")>=1) { // IE  
                    url = document.getElementById(sourceId).value;  
                } else if(navigator.userAgent.indexOf("Firefox")>0) { // Firefox  
                    url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));  
                } else if(navigator.userAgent.indexOf("Chrome")>0) { // Chrome  
                    url = window.URL.createObjectURL(document.getElementById(sourceId).files.item(0));  
                }  
                return url;  
            }  
            function preImg(sourceId, targetId) {   
                var url = getFileUrl(sourceId);   
                var imgPre = document.getElementById(targetId);   
                imgPre.src = url;   
            }   
    </script>  
</html>